import 'package:get/get.dart';
import 'package:flutter/material.dart';

extension StrExt on String {
  String placeHolder(String placeholder) {
    bool isNull = this == 'null' || isEmpty || trim().isEmpty;
    return isNull ? placeholder : this;
  }

  Widget requiredWidget({TextStyle? style}) => Text.rich(TextSpan(
          text: this,
          style: style ?? Get.textTheme.titleMedium,
          children: [
            TextSpan(
                text: '*',
                style: (style ?? Get.textTheme.titleMedium)?.copyWith(
                  color: const Color(0xFFFF0016),
                )),
          ]));
}
